<?php
/**
 * Created by PhpStorm.
 * User: tairy
 * Date: 08/06/2018
 * Time: 10:29
 */

require_once __DIR__ . '/../vendor/autoload.php';

if (extension_loaded('swoole') && php_sapi_name() == 'cli') {
    try {
        \Core\Server\SwooleServer::getInstance()
            ->setServerConfig(__DIR__ . '/swoole.ini')
            ->setAppConfig(__DIR__ . '/app.ini')
            ->start();
    } catch (\Exception $e) {
        echo $e->getMessage();
    }
} else {
    die('swoole not found.');
}